package com.ahaoyou.service.impl;

import com.ahaoyou.entity.User;
import com.ahaoyou.excel.ExcelDataListener;
import com.ahaoyou.mapper.UserMapper;
import com.ahaoyou.service.UserService;
import com.alibaba.excel.EasyExcel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;

/**
 * @Author LH
 * @create 2021/12/31 11:08
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void importUser(InputStream in) {
        EasyExcel.read(in, User.class, new ExcelDataListener(userMapper)).sheet().doRead();
    }


}
